/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package DEMOS;

import edu.chalmers.AV_2DPlatformerFramework.Model.AnimatedTexture;
import edu.chalmers.AV_2DPlatformerFramework.Model.GameObject;
import edu.chalmers.AV_2DPlatformerFramework.Model.Hitbox;
import edu.chalmers.AV_2DPlatformerFramework.Utility.Utility;
import edu.chalmers.AV_2DPlatformerFramework.Utility.Vector2D;
import java.awt.geom.Rectangle2D;

/**
 *
 * @author Richard
 */
public class demo_redAnim extends GameObject{

    public demo_redAnim(Vector2D finalVelocity) {
        super(null);
        
        Vector2D[] vertices = { 
                                new Vector2D(0, 100), new Vector2D(25, 25),
                                new Vector2D(100,0), new Vector2D(175, 25), 
                                new Vector2D(200, 100), new Vector2D(175, 175),
                                new Vector2D(100, 200), new Vector2D(25, 175),
                              }; 
        try {
            this.setHitbox(new Hitbox(vertices));
        } catch (Hitbox.HitboxMalformedException ex) {
            System.out.println("Failed to create hitbox for red.");
        }
        
        String s = System.getProperty("file.separator");
        AnimatedTexture at = new AnimatedTexture(Utility.buildTextureArray("."+s+"src"+s+"main"+s+"java"+s+"Textures"
                            +s+"demo_anim_red", new Rectangle2D.Double()), 2);
        addTexture(at);
        super.setVelocity(finalVelocity);
    }

    @Override
    public void onCollision(GameObject otherObject) {} //do nothing

    @Override
    public GameObject copy() {
        GameObject copy = new demo_redAnim(getVelocity());
        this.copyVariablesTo(copy);
        return copy;
    }
    
}
